import request from '@/utils/request';
// 获取广告列表
export async function pageGathers(data) {
  const res = await request.post('/GatherList', data);
  // console.log(666666666, res);
  if (res.status === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.msg));
}
// 删除
export async function removeGather(ids) {
  const res = await request.post('/DeleteGather', ids);

  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 批量删除
export async function removeGathers(data) {
  const res = await request.post('/DeleteGather', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 添加广告
export async function addGather(data) {
  const res = await request.post('/CreateGather', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
}
// 修改广告
export const updateGather = async (data) => {
  const res = await request.post('/UpdateGather', data);
  if (res.status === 0) {
    return res.msg;
  }
  return Promise.reject(new Error(res.msg));
};
